package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.Address;
import com.xmtlxx.tms.domain.bo.AddressBo;
import com.xmtlxx.tms.domain.vo.AddressVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 地址Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface AddressMapper extends BaseMapperPlus<AddressMapper, Address, AddressVo> {
    /**
     * 根据条件分页查询地址
     *
     * @param address 地址
     * @return Page Address
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "a.create_by"),
        @DataColumn(key = "deptName", value = "a.dept_id"),
        @DataColumn(key = "userName", value = "a.create_by")
    })
    Page<AddressVo> selectPageAddressList(@Param("page") Page<Address> page,@Param("address") AddressBo address);

    /**
     * 查询地址列表
     *
     * @param address 地址
     * @return 地址集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "a.create_by"),
        @DataColumn(key = "deptName", value = "a.dept_id"),
        @DataColumn(key = "userName", value = "a.create_by")
    })
    List<AddressVo> selectAddressList(@Param("address") AddressBo address);

    AddressVo selectAddressVoByID(String id);
}
